package testFileRW;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;


/*new object
 * writeaLine is to append a string to the end of a file
 * 
 * */
public class FileOut {
	String tmp = null;
	File file = null;
	PrintWriter writer = null;

	public void writeaLine(String str,String txt) {

		try {
			writer = new PrintWriter(
					new FileWriter(
					new File("G:\\test\\"+txt),true));
			writeLine(str);
			writer.close();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public void writeLine(String str) {
		writer.println(str);
		
	}

	public void closeFile() {
		writer.close();
	}
}
